#define _CRT_SECURE_NO_WARNINGS 1
#include<iostream>
#include<vector>
using namespace std;

void vector1()
{
	vector<int> v;
	v.push_back(1);
	v.push_back(2);
	v.push_back(3);
	v.push_back(4);

	for (auto e : v)
	{
		cout << e << " ";
	}
	cout << endl;

	//auto it = v.begin();
	vector<int> ::iterator it = v.begin();
	while (it != v.end())
	{
		cout << *it << " ";
		it++;
	}
	cout << endl;

	for (size_t i = 0; i < v.size(); i++)
	{
		cout << v[i] << " ";
	}
	cout << endl;

}

void vector2()
{
	vector<int> v(10,1);
	for (auto e : v)
	{
		cout << e << " ";
	}
	cout << endl;

	vector<int> v2(v.begin(), v.end());
	for (auto e : v)
	{
		cout << e << " ";
	}
	cout << endl;

	string s1("abcdefg");
	vector<int> v3(s1.begin(), s1.end());
	for (auto e : v)
	{
		cout << e << " ";
	}
	cout << endl;

}

void vector3()
{
	vector<int> v;
	v.push_back(1);
	v.push_back(2);
	v.push_back(3);
	v.push_back(4);
	v.push_back(5);
	v.push_back(6);
	v.push_back(7);
	v.push_back(8);

	for (auto e : v)
	{
		cout << e << " ";
	}
	cout << endl;

	auto it = find(v.begin(),v.end(),1);
	v.insert(it,10);
	for (auto e : v)
	{
		cout << e << " ";
	}
	cout << endl;

}

void vector4()
{
	vector<int> v;
	v.resize(20);
	v.push_back(1);
	for (auto e : v)
	{
		cout << e << " ";
	}
	cout << endl;

	vector<int> v1;
	v1.reserve(20);
	v1.push_back(1);
	for (auto e : v1)
	{
		cout << e << " ";
	}
	cout << endl;

}


//int main()
//{
//	vector4();
//	return 0;
//}


#include <iostream>
#include <vector>

int main()
{
	std::vector<int> foo(3, 3);
	std::vector<int> bar(5, 5);

	for (auto e : foo)
	{
		cout << e << " ";
	}
	cout << endl;

	for (auto e : bar)
	{
		cout << e << " ";
	}
	cout << endl;

	bar = foo;

	for (auto e : bar)
	{
		cout << e << " ";
	}
	cout << endl;

	//foo = std::vector<int>();


	//std::cout << "Size of foo: " << int(foo.size()) << '\n';
	//std::cout << "Size of bar: " << int(bar.size()) << '\n';
	return 0;
}